@echo off
echo ==========================================
echo   Building Kernel Load Test
echo ==========================================
echo.

nasm -f bin test_load_kernel.asm -o test-boot.bin
if %ERRORLEVEL% NEQ 0 goto error

nasm -f bin test_simple_kernel.asm -o test-kernel.bin
if %ERRORLEVEL% NEQ 0 goto error

copy /b test-boot.bin + test-kernel.bin test-load-image.bin >nul
fsutil file seteof test-load-image.bin 8192 >nul 2>nul

echo [OK] test-boot.bin
echo [OK] test-kernel.bin
echo [OK] test-load-image.bin
echo.
dir test-boot.bin test-kernel.bin test-load-image.bin | findstr ".bin"
echo.
echo To run: qemu-system-i386 -drive format=raw,file=test-load-image.bin
pause
goto end

:error
echo [ERROR] Build failed!
pause
exit /b 1

:end

